package com;

import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
@WebServlet("/UploadServlet")
@MultipartConfig
public class UploadServlet extends HttpServlet{
	private DataManager dataManager = new DataManager();
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response){
		// Upload the data to the database
		dataManager.uploadData(request, response);
	   
		try {
			// Redirect the user to the Rule Violations page
			response.sendRedirect("ruleviolations.jsp");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}